<?php
//upload.php
header('KissyIoDataType:json');
$response = $imgService->upload("/test.jpg", NULL);
$imgname = $_GET["name"];
if($response->isSuccess()){
    $json['success'] = true;
    $json['errorMsg'] = 'no error';
    
    $img = $response->getResult();
        
    $json['id'] = $img->id;
    $json['name'] = $img->name;
    $json['url'] = $img->url;
    $json['size'] = $img->size;
    $json['size'] = $img->size;
    $json['img'] = $imgname;
} else {
    $json['sucess'] = false;
    $json['errorMsg'] = $response->getErrorMsg();
}

echo json_encode($json);
?>